#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
	char arr[200] = {0};
	gets(arr);
	int count = 0;
	int n = 0;
	int sz = strlen(arr);
	for (int i = 0; i < sz; i++) {
		if (arr[i] != ' ') {
			count++;
		}
		if (arr[i] == ' ' && arr[i - 1] != ' ') {
			printf("%d ", count);
			count = 0;
			n++;
		}
		if (arr[i] != ' ' && arr[i + 1] == 0) {
			printf("%d ", count);
			n++;
		}
	}
	if (n == 0) {
		printf("0");
	}
	return 0;
}